-module(usr_sup).

-behavior(supervisor).
-export([start_link/0]).
-export([init/1]).

-behavior(application).
-export([start/2,stop/1]). % application

%% supervisor
start_link() -> 
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).

init(FileName) -> 
    UsrChild = {usr, {usr, start_link, []},
                permanent, 2000, worker, [usr, usr_db]},
    {ok, {{one_for_all, 1, 1}, [UsrChild]}}.

%% application
start(_Type, _StartArgs) ->
    usr_sup:start_link().

stop(_State) ->
    ok.
